<?php

namespace GamesBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @author  coffey  <coffey@nligo.com>
 * GamesUserOrder
 *
 * 游戏订单表
 * @ORM\Table(name="games_user_order")
 * @ORM\Entity(repositoryClass="GamesBundle\Repository\GamesUserOrderRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class GamesUserOrder
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false,options={"comment":"订单自增id"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="order_sn", type="string", length=50, nullable=false,options={"comment":"订单编号"})
     */
    private $orderSn = '';

    /**
     * @ORM\ManyToOne(targetEntity="User")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    private $userId;

    /**
     * @var string
     *
     * @ORM\Column(name="nper", type="string", length=120, nullable=false,options={"comment":"期数"})
     */
    private $nper = "";

    /**
     * @ORM\ManyToOne(targetEntity="Games")
     * @ORM\JoinColumn(name="game_id", referencedColumnName="id")
     */
    private $gameId;

    /**
     * @var string
     *
     * @ORM\Column(name="game_type", type="string", length=120, nullable=false,options={"comment":" 默认为0 游戏类型 1为数字 2为中文"})
     */
    private $gameType = '';

    /**
     * @var string
     *
     * @ORM\Column(name="car_num", type="string", length=50, nullable=false,options={"comment":"赛车编号（或名次排号）"})
     */
    private $carNum = '';

    /**
     * @var string
     *
     * @ORM\Column(name="game_type_name", type="string", length=120, nullable=false,options={"comment":"游戏类型名称 123   龙虎  大小这种"})
     */
    private $gameTypeName = '';

    /**
     * @var string
     *
     * @ORM\Column(name="order_str", type="string", length=120, nullable=false,options={"comment":"下注时的字符串"})
     */
    private $orderStr = '';

    /**
     * @var integer
     *
     * @ORM\Column(name="bit_money", type="integer", nullable=false,options={"comment":"投注分额"})
     */
    private $bitMoney = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="status", type="integer", nullable=false,options={"comment":"订单状态 0为有效 1为无效 默认启用"})
     */
    private $status = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="is_del", type="integer", nullable=false,options={"comment":"是否删除 0为正常 1为删除 2为取消"})
     */
    private $isDel = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="create_at", type="integer", nullable=false,options={"comment":"创建时间"})
     */
    private $createAt = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="update_at", type="integer", nullable=false,options={"comment":"更新时间"})
     */
    private $updateAt = '0';

    /**
     * @ORM\ManyToOne(targetEntity="GameNperRecord")
     * @ORM\JoinColumn(name="game_nper_record_id", referencedColumnName="id")
     */
    private $GameNperRecordId;

    /**
     * @ORM\PrePersist
     */
    public function PrePersist(){
        $this->setCreateAt(time());
        $this->setUpdateAt(time());
    }

    /**
     * @ORM\PreUpdate
     */
    public function PreUpdate(){
        $this->setCreateAt(time());
    }


    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set orderSn
     *
     * @param string $orderSn
     *
     * @return GamesUserOrder
     */
    public function setOrderSn($orderSn)
    {
        $this->orderSn = $orderSn;

        return $this;
    }

    /**
     * Get orderSn
     *
     * @return string
     */
    public function getOrderSn()
    {
        return $this->orderSn;
    }

    /**
     * Set carNum
     *
     * @param string $carNum
     *
     * @return GamesUserOrder
     */
    public function setCarNum($carNum)
    {
        $this->carNum = $carNum;

        return $this;
    }

    /**
     * Get carNum
     *
     * @return string
     */
    public function getCarNum()
    {
        return $this->carNum;
    }

    /**
     * Set gameTypeName
     *
     * @param string $gameTypeName
     *
     * @return GamesUserOrder
     */
    public function setGameTypeName($gameTypeName)
    {
        $this->gameTypeName = $gameTypeName;

        return $this;
    }

    /**
     * Get gameTypeName
     *
     * @return string
     */
    public function getGameTypeName()
    {
        return $this->gameTypeName;
    }

    /**
     * Set bitMoney
     *
     * @param integer $bitMoney
     *
     * @return GamesUserOrder
     */
    public function setBitMoney($bitMoney)
    {
        $this->bitMoney = $bitMoney;

        return $this;
    }

    /**
     * Get bitMoney
     *
     * @return integer
     */
    public function getBitMoney()
    {
        return $this->bitMoney;
    }

    /**
     * Set totalScore
     *
     * @param integer $totalScore
     *
     * @return GamesUserOrder
     */
    public function setTotalScore($totalScore)
    {
        $this->totalScore = $totalScore;

        return $this;
    }

    /**
     * Get totalScore
     *
     * @return integer
     */
    public function getTotalScore()
    {
        return $this->totalScore;
    }

    /**
     * Set status
     *
     * @param integer $status
     *
     * @return GamesUserOrder
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set isDel
     *
     * @param integer $isDel
     *
     * @return GamesUserOrder
     */
    public function setIsDel($isDel)
    {
        $this->isDel = $isDel;

        return $this;
    }

    /**
     * Get isDel
     *
     * @return integer
     */
    public function getIsDel()
    {
        return $this->isDel;
    }

    /**
     * Set createAt
     *
     * @param integer $createAt
     *
     * @return GamesUserOrder
     */
    public function setCreateAt($createAt)
    {
        $this->createAt = $createAt;

        return $this;
    }

    /**
     * Get createAt
     *
     * @return integer
     */
    public function getCreateAt()
    {
        return $this->createAt;
    }

    /**
     * Set updateAt
     *
     * @param integer $updateAt
     *
     * @return GamesUserOrder
     */
    public function setUpdateAt($updateAt)
    {
        $this->updateAt = $updateAt;

        return $this;
    }

    /**
     * Get updateAt
     *
     * @return integer
     */
    public function getUpdateAt()
    {
        return $this->updateAt;
    }

    /**
     * Set userId
     *
     * @param \GamesBundle\Entity\User $userId
     *
     * @return GamesUserOrder
     */
    public function setUserId(\GamesBundle\Entity\User $userId = null)
    {
        $this->userId = $userId;

        return $this;
    }

    /**
     * Get userId
     *
     * @return \GamesBundle\Entity\User
     */
    public function getUserId()
    {
        return $this->userId;
    }

    /**
     * Set GameNperRecordId
     *
     * @param \GamesBundle\Entity\GameNperRecord $GameNperRecordId
     *
     * @return GamesUserOrder
     */
    public function setGameNperRecordId(\GamesBundle\Entity\GameNperRecord $GameNperRecordId = null)
    {
        $this->GameNperRecordId = $GameNperRecordId;

        return $this;
    }

    /**
     * Get GameNperRecordId
     *
     * @return \GamesBundle\Entity\GameNperRecord
     */
    public function getGameNperRecordId()
    {
        return $this->GameNperRecordId;
    }



    /**
     * Set gameId
     *
     * @param \GamesBundle\Entity\Games $gameId
     *
     * @return GamesUserOrder
     */
    public function setGameId(\GamesBundle\Entity\Games $gameId = null)
    {
        $this->gameId = $gameId;

        return $this;
    }

    /**
     * Get gameId
     *
     * @return \GamesBundle\Entity\Games
     */
    public function getGameId()
    {
        return $this->gameId;
    }

    /**
     * Set nper
     *
     * @param string $nper
     *
     * @return GamesUserOrder
     */
    public function setNper($nper)
    {
        $this->nper = $nper;

        return $this;
    }

    /**
     * Get nper
     *
     * @return string
     */
    public function getNper()
    {
        return $this->nper;
    }

    /**
     * Set gameType
     *
     * @param string $gameType
     *
     * @return GamesUserOrder
     */
    public function setGameType($gameType)
    {
        $this->gameType = $gameType;

        return $this;
    }

    /**
     * Get gameType
     *
     * @return string
     */
    public function getGameType()
    {
        return $this->gameType;
    }

    /**
     * Set orderStr
     *
     * @param string $orderStr
     *
     * @return GamesUserOrder
     */
    public function setOrderStr($orderStr)
    {
        $this->orderStr = $orderStr;

        return $this;
    }

    /**
     * Get orderStr
     *
     * @return string
     */
    public function getOrderStr()
    {
        return $this->orderStr;
    }
}
